package com.googlecode.smartbinding.framework.core;

import com.googlecode.smartbinding.framework.events.listener.SourceChangedListener;
import com.googlecode.smartbinding.framework.events.listener.TargetChangedListener;
import com.googlecode.smartbinding.framework.events.listener.ValidationStatusChangedListener;

import java.util.List;

/**
 * Default implementation for a {@link BindingResult}
 *
 * @author Iulian Dumitru
 */
public class BindingResultImpl implements BindingResult {

    private BindingContext bindingContext;

    public BindingResultImpl(BindingContext bindingContext) {
        this.bindingContext = bindingContext;
    }

    @Override
    public BindingResult addSourceChangedListener(SourceChangedListener sourceChangedListener) {
        return null;
    }

    @Override
    public BindingResult addTargetChangedListener(TargetChangedListener targetChangedListener) {
        return this;
    }

    @Override
    public List<BindingUnit> getBindings() {
        return bindingContext.getBindings();
    }

    @Override
    public BindingContext getBindingContext() {
        return bindingContext;
    }

    @Override
    public boolean hasValidationErrors() {
        return false;
    }

    @Override
    public void updateSource() {
    }

    @Override
    public void updateTarget() {
    }

}
